import 'dart:convert';
import 'package:enterprise_v6_app/app/data/common/choice_bean.dart';
import 'package:enterprise_v6_app/app/data/entities/application/execute_entity.dart';
import 'package:enterprise_v6_app/generated/json/base/json_field.dart';
import 'package:enterprise_v6_app/generated/json/ticket_plan_entity.g.dart';
export 'package:enterprise_v6_app/generated/json/ticket_plan_entity.g.dart';

///作业计划实体类
@JsonSerializable()
class TicketPlanEntity extends ChoiceBean {
  TicketPlanEntity();

  factory TicketPlanEntity.fromJson(Map<String, dynamic> json) => $TicketPlanEntityFromJson(json);

  ///	申请人用户姓名
  String? applyUserName = '';

  ///	属地单位名称
  String? departmentName = '';

  ///	主键ID
  String? id = '';

  ///	涉及作业
  String? involvedWorkName = '';

  ///	作业计划结束时间
  String? planEndDate = '';

  ///	作业计划开始时间
  String? planStartDate = '';

  ///	流程流转状态
  String? processTypes = '';

  ///	作业票列表
  List<TicketPlanReceiptLists>? receiptLists = [];

  ///	作业地点
  String? ticketAddress = '';

  ///	作业内容
  String? ticketContent = '';

  ///	作业名称
  String? ticketName = '';

  ///	作业编号
  String? ticketNo = '';

  ///	作业来源
  String? ticketSource = '';

  /// 申请单位id
  String? applyDepartmentId = '';

  /// 申请单位名称
  String? applyDepartmentName = '';

  /// 风险辨识结果id
  List<String>? ticketIdentityId = [];

  /// 风险辨识结果
  String? ticketIdentityName = '';

  /// 风险辨识人id
  String? identityUserId = '';


  Map<String, dynamic> toJson() => $TicketPlanEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

  @override
  String getId() {
    return id!;
  }

  @override
  String getShowName() {
    return ticketName!;
  }

}

///	作业票列表
@JsonSerializable()
class TicketPlanReceiptLists {
  TicketPlanReceiptLists();

  factory TicketPlanReceiptLists.fromJson(Map<String, dynamic> json) => $TicketPlanReceiptListsFromJson(json);

  /// 申请人姓名
  String? applyUserName = '';

  /// 申请人id
  String? applyUserId = '';

  ///	作业结束时间
  String? endDate = '';

  // ///	监护人姓名
  // String? guardianUserName = '';
  //
  // ///	监护人id
  // String? guardianUserId = '';

  /// 监护人列表
  List<ExecuteTicketReceiptListOperatorLists> guardianList = [];

  ///	主键ID
  String? id = '';

  ///	作业计划结束时间
  String? planEndDate = '';

  ///	作业计划开始时间
  String? planStartDate = '';

  ///	作业开始时间
  String? startDate = '';

  ///	作业大类字典名称
  String? ticketBigTypeName = '';

  ///	作业计划ID
  String? ticketPlanId = '';

  ///	作业状态 0：待开票 1：开票中 2：进行中 3：中断 4：已验收
  int? type = 0;

  ///流程唯一编码
  String? processEncoding = '';

  ///	是否在交接班中 0：否 1：是
  int? isChange = 0;

  /// 直播状态 [liveStatus] 直播状态 0:待直播 1:正在直播 2:直播结束
  int? liveStatus;

  Map<String, dynamic> toJson() => $TicketPlanReceiptListsToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
